<template>
  <div class="app-container">
    <basic-table
      :table-title="tableTitle"
      :data-source="dataSource"
      :button-group="buttonGroup"
      :search-form="searchForm"
      :model-type="'userReport'"
      :multiple-table="false"
      :reload="reload"
      @closeReload="closeReload"
      >
      <template v-slot:IncrementRate="scope">
        <div style="color: #E6A23C">
       {{ scope.row.IncrementRate }}
        </div>
      </template>
    </basic-table>
  </div>
</template>
<script>
import { getUserForms } from '@/api/report'
import BasicTable from '@/components/BasicTable/index.vue'
export default {
  name: 'User',
  components: { BasicTable },
  data() {
    return {
      reload: false,
      dataSource: () => getUserForms,
      tableTitle: [
      {
          label: '用户名',
          value: 'UserName',
          show: true,
          type: 'text',
        },
        {
          label: '用户所属企业',
          value: 'UserCompanyName',
          show: true,
          type: 'text',
        },
        {
          label: '登录次数',
          value: 'LoginNum',
          show: true,
          type: 'text',
        },
        {
          label: '搜索企业次数',
          value: 'SearchCompanyNum',
          show: true,
          type: 'text'
        },
        {
          label: '查看企业详情次数',
          value: 'CompanyInfoNum',
          show: true,
          type: 'text'
        },
        {
          label: '解锁企业次数',
          value: 'CompanyUnlockNum',
          show: true,
          type: 'text'
        },
        {
          label: '添加客户数',
          value: 'AddClientNum',
          show: true,
          type: 'text'
        },
      ],
      searchForm: {
        expend: true,
        title: '',
        fields: [
        {
            show: true,
            type: 'input',
            label: '用户名',
            labelShow: true,
            name: 'username'
          },
        {
            show: true,
            type: 'input',
            label: '用户所属企业',
            labelShow: true,
            name: 'userCompanyName'
          },
      
          {
            show: true,
            type: 'select',
            label: '排序方式',
            labelShow: true,
            name: 'sortFieldId',
            options: [
              { value: '1', label: '登录次数' },
              { value: '2', label: '搜索次数' },
              { value: '3', label: '查看详情次数' },
              { value: '4', label: '解锁企业次数' },
              { value: '5', label: '添加客户数' },
            ]
          },
          {
            show: true,
            type: 'select',
            label: '',
            labelShow: true,
            name: 'sortType',
            options: [
              { value: '0', label: '从少到多' },
              { value: '1', label: '从多到少' }
            ]
          },
          {
            show: true,
            type: 'datetimerange',
            label: '统计时间',
            labelShow: true,
            name: 'time'
          },
        ]
      },
      buttonGroup: {},
    }
  },
  created(){
  },
  methods: {
    closeReload(val) {
      this.reload = val
    },
  }
}
</script>

<style scoped></style>
